package cn.koala.key.receipt.service.impl;

import cn.koala.key.api.KeyManagementApi;
import cn.koala.key.common.feign.FeignUtils;
import cn.koala.key.entity.KeyInfo;
import cn.koala.key.receipt.dto.BorrowOrderDetailDTO;
import cn.koala.key.receipt.service.BorrowOrderDetailService;
import cn.seed.common.core.Result;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BorrowOrderDetailServiceImpl implements BorrowOrderDetailService {

    @Override
    public Result<List<KeyInfo>> getByOrderNo(String orderNo) {
        return FeignUtils.getHttpApi(KeyManagementApi.class).selectKeyInfosByOrderNo(orderNo);
    }

    @Override
    public Result lend(BorrowOrderDetailDTO borrowOrderDetailDTO) {
        return FeignUtils.getHttpApi(KeyManagementApi.class).lend(borrowOrderDetailDTO);
    }
}
